package com.common.app.data.bean.home

import android.os.Parcelable
import com.common.app.R
import com.common.app.data.bean.overView.CardSettingModel
import com.common.base.utils.ViewUtils
import kotlinx.parcelize.Parcelize

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2022/8/20
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
@Parcelize
data class HomeDetailBean(
    var BgColor: String? = null,//背景色,默认白色
    var TextColor: String? = null,//页面文字颜色，默认黑色
) : Parcelable

/**
 * 卡片设置数据模型
 */
@Parcelize
data class HomeMainCardModel(
    val chart_data: String = "",//
    val chart_type: String = "",//
    var id: Int = 0,//
    var notification_type: String = "",//
    var possible_questions: String = "",//
    var summary: String = "",//
    var title: String = "",//
    var ai_analyze_result: HomeMainAIAnalyzeResultBean? = null,//
) : Parcelable {
    fun getItemType():Int{
        return when (notification_type) {
            "sleep" -> 1
            "active" -> 2
            else -> 0
        }
    }
}

@Parcelize
data class HomeMainAIAnalyzeResultBean(
    val affirmation: String = "",//
    val impact: String = "",//
    var improvement: String = "",//
    var reason: String = "",//
    var suggestion: String = "",//
) : Parcelable

@Parcelize
data class ScoringFactorsModel(
    val date: String = "",//日期
    val total_score: Float = 0f,//总分
    var total_grade: String = "",//总评级
    var ai_analyza: String = "",//AI分析信息
    var score_types:List<ScoringClassListBean>? = null,
) : Parcelable{

    fun getGradeStr():String{
        return when(total_grade){
            "excellent"-> ViewUtils.getString(R.string.common_excellent_hint2)//优秀
            "good"-> ViewUtils.getString(R.string.common_good_hint)//良好
            "improvable"-> ViewUtils.getString(R.string.common_acceptable_hint2)//可改善
            "severity"-> ViewUtils.getString(R.string.common_not_good_hint2)//严重
            else-> ViewUtils.getString(R.string.common_rail_unit)
        }
    }
}

@Parcelize
data class ScoringClassListBean(
    var type: String = "",//
    val status: String = "",// 区分正常、无数据和异常 normal/no_data/anomalous
    var score_items:List<ScoringItemBean>? = null,
    var items:List<ScoringBaseLineItemBean>? = null,
) : CardSettingModel(), Parcelable{
    fun getCusItemType():Int{
        return when(type){
            "improvable","excellent","good","severity"-> 1//优秀//良好//可改善
            "heart","hrv","temperature","spo","breath"-> 2
            else ->0
        }
    }
}

@Parcelize
data class ScoringItemBean(
    var name: String = "",//评分项名称
    val score: Int = 0,//分数 (0-100)
    var grade: String = "",//评级: 优秀/良好/建议改善
    var category: String = "",//分类: 优秀/良好/可改善
    var description: String = "",//具体数值描述
    var target: Float = 0f,//满分标准值

) : Parcelable

@Parcelize
data class ScoringBaseLineItemBean(
    var time_period: String = "",//时间段
    var current_value: Float = 0f,//当前值
//    var history_value: Float = 0f,//历史基准
    var exceeded_value: Float = 0f,//溢出值
) : Parcelable


@Parcelize
data class AllScoringModel(
    var total_grade: String? = "",//总评级
    val total_score: Int = 0,//权重总体评分
    var list: List<AllScoringItemBean>? = null

) : Parcelable
@Parcelize
data class AllScoringItemBean(
    val total_score: Int = 0,//总分 (0-100)
    var total_grade: String? = "",//总评级
    var analysis_type: String? = "",//分析类型: activity/stress/vital_sign/sleep
    var analysis_date: String? = "",//分析日期
    var ai_analysis: String? = "",//AI分析结果
) : Parcelable